Generación (o actualización) del archivo local de datos de PVPC recogidos en https://www.esios.ree.es/
In [3]:
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
from esiosdata import PVPC
from esiosdata.prettyprinting import *
pvpc_handler = PVPC()
In [40]:
print_ok('Códigos de tarifas: {}'.format(pvpc_handler.tarifas))
ts_last, nrows_tot = pvpc_handler.last_entry()
print_cyan('TS LAST VALUE: {}; TOTAL VALUES: {}'.format(ts_last, nrows_tot))
df_pvpc = pvpc_handler.data['data']
print_ok('Columnas de datos de PVPC: {}'.format(df_pvpc.columns))
print_red('Últimos valores:\n{}'.format(df_pvpc[pvpc_handler.tarifas].tail(24)))
In [41]:
pvpc_mean_daily, pvpc_mean_monthly = pvpc_handler.get_resample_data()
print_yellow(pvpc_mean_daily[pvpc_handler.tarifas].tail(10))
print_magenta(pvpc_mean_monthly[pvpc_handler.tarifas].tail(10))
In [42]:
from esiosdata.importpvpcdata import pvpc_data_dia
data_dia = pvpc_data_dia(str_dia='2017-01-25')
print_red(data_dia[pvpc_handler.tarifas])
In [45]:
from esiosdata.pvpcplot import (pvpcplot_ev_scatter, pvpcplot_grid_hora, pvpcplot_tarifas_hora,
pvpcplot_fill_tarifa)
FIGSIZE = (16, 9)
# PLOTS EV. DIARIA Y MENSUAL:
pvpcplot_ev_scatter(pvpc_mean_daily, pvpc_mean_monthly, tarifa='GEN')
pvpcplot_ev_scatter(pvpc_mean_daily, pvpc_mean_monthly, tarifa='NOC')
pvpcplot_ev_scatter(pvpc_mean_daily, pvpc_mean_monthly, tarifa='VHC', superposic_anual=False)
In [46]:
fig, ax = plt.subplots(figsize=FIGSIZE)
for k in pvpc_handler.tarifas:
pvpcplot_ev_scatter(pvpc_mean_daily, pvpc_mean_monthly, tarifa=k, superposic_anual=False, ax=ax, plot=False)
plt.show()
In [49]:
# PLOTS DIARIOS (O DE INTERVALO HORARIO):
df_day = df_pvpc.loc['2017-01-25']
pvpcplot_grid_hora(df_day)
In [52]:
pvpcplot_grid_hora(df_pvpc.loc['2017-01-10':'2017-01-25'])
In [54]:
pvpcplot_tarifas_hora(df_pvpc.loc['2017-01-01':'2017-01-26'], plot_perdidas=False)